<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsergroupMenuActionScopesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_group_menu_action_scopes', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('group_id')->comment('用户组ID');
            $table->unsignedInteger('menu_id')->comment('菜单ID');
            $table->unsignedInteger('action_id')->comment('功能ID');
            $table->unsignedInteger('scope_id')->comment('数据域ID');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '菜单功能数据域表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_group_menu_action_scopes');
    }

}
